varying vec3 tnorm;
varying vec3 lvec;
varying vec3 hvec;
const vec4 diff = vec4(1.0, 0.1, 0.1, 1.0);
const vec4 amb = vec4(0.2, 0.0, 0.0, 1.0);
void main (void) 
{
  vec3 l = normalize(lvec);
  vec3 n = normalize(tnorm);
  vec3 h = normalize(hvec);
  float d = max(dot(l,n),0.0);
  vec4 diffcomp = d*diff;
  float s = 0.0;
  if(d>0.0){
    s = max(dot(h,n),0.0);
    s = pow(s,50.0);
  }
  vec4 spec = vec4(1.0,1.0,1.0,1.0) * s;
  gl_FragColor = diffcomp + spec + amb;
}
